package com.rock.sys.global;

import com.eova.aop.AopContext;

/**
 * APP角色绑定拦截器基类
 * @author jadison
 *
 */
public class RoleAppBindIntercept extends RockMetaIntercept{

	/**
     * 角色绑定前置任务(事务内)
     * <pre>
     * ac.record 当前操作数据
     * -------------
     * 用法：自动赋值
     * ac.record.set("update_time", new Date());
     * ac.record.set("user_id", ac.user.get("id"));
     *
     * 用法：唯一值判定
     * int count = Db.queryInt("select count(*) from users where name = ?", ac.record.getStr("name"));
     * if (count > 0) {
     *     return Easy.error("名字被占用了");
     * }
     * </pre>
     */
    public String bindBefore(AopContext ac) throws Exception {
    	return null;
    }
    
    /**
     * 角色绑定后置任务(事务内)
     * <pre>
     * ac.record 当前操作数据
     * -------------
     * 用法：自动赋值
     * ac.record.set("update_time", new Date());
     * ac.record.set("user_id", ac.user.get("id"));
     *
     * 用法：唯一值判定
     * int count = Db.queryInt("select count(*) from users where name = ?", ac.record.getStr("name"));
     * if (count > 0) {
     *     return Easy.error("名字被占用了");
     * }
     * </pre>
     */
    public String bindAfter(AopContext ac) throws Exception {
    	return null;
    }
    
    /**
     * 角色绑定后置任务(事务外)
     * <pre>
     * ac.record 当前操作数据
     * -------------
     * 用法：自动赋值
     * ac.record.set("update_time", new Date());
     * ac.record.set("user_id", ac.user.get("id"));
     *
     * 用法：唯一值判定
     * int count = Db.queryInt("select count(*) from users where name = ?", ac.record.getStr("name"));
     * if (count > 0) {
     *     return Easy.error("名字被占用了");
     * }
     * </pre>
     */
    public String bindSucceed(AopContext ac) throws Exception {
    	return null;
    }

    /**
     * 角色解除前置任务(事务内)
     * @param userId 用户id
     * @param roleId 角色id
     * @return
     * @throws Exception
     */
    public String removeBefore(Integer userId, Integer roleId) throws Exception {
    	return null;
    }

    /**
     * 角色解除后置任务(事务内)
     * @param userId 用户id
     * @param roleId 角色id
     * @return
     * @throws Exception
     */
	public String removeAfter(Integer userId, Integer roleId) throws Exception {
		return null;
	}
	
}
